﻿using System.Text;
using System.Windows.Forms;
using System.IO;

namespace SeriesUtil.Helper
{
    public class Log : TextWriter
    {
        TextBox log;

        public Log(TextBox log)
        {
            this.log = log;
        }

        public override void Write(char value)
        {
            base.Write(value);
            // When character data is written, append it to the text box.
            log.AppendText(value.ToString());
        }

        public override Encoding Encoding
        {
            get { return System.Text.Encoding.UTF8; }
        }
    }
}
